package com.xiaoyu.lanling.event.login

import `in`.srain.cube.request.JsonData
import com.xiaoyu.base.event.BaseJsonEvent
import com.xiaoyu.lanling.app.AppHelper

open class LoginEvent(requestTag: Any, jsonData: JsonData) : BaseJsonEvent(requestTag, jsonData) {

    val status = jsonData.optString("status")
    val hasSetProfile = jsonData.optBoolean("hasSetProfile")

    init {
        if (status == STATUS_ENABLE) {
            AppHelper.afterLogin(jsonData)
        }
    }

    companion object {
        const val STATUS_ENABLE = "enable"
        const val STATUS_DISABLE = "disable"
    }
}